<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$setting=$this->setting;
$return['banner']=$setting['hdps'];
$return['setting']=$setting;
if($_RQ['op']=='main'){
	/*******main*******/
	//首页轮播图
	//首页推荐
	$show_list=pdo_getall('jy_baoming_list',array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'status'=>'1','isshow'=>'1'),'','','paixu asc');
	//print_r($show_list);exit;
	if($show_list){
		foreach($show_list as &$item){
			$num1=pdo_count('jy_baoming_order',array('uniacid'=>$_SESSION['uniacid'],'activity_id'=>$item['id'],'status'=>'1'));
			$num2=pdo_count('jy_baoming_order',array('uniacid'=>$_SESSION['uniacid'],'activity_id'=>$item['id'],'status'=>'2'));
			$num3=pdo_count('jy_baoming_order',array('uniacid'=>$_SESSION['uniacid'],'activity_id'=>$item['id'],'status'=>'4'));
			$item['num']=$num1+$num2+$num3;
			if($item['mannum']-$item['num'] >= 0){
			$item['left']=$item['mannum']-$item['num'];
			}else{
			$item['left']=0;
			}
		}
	}
	$return['show_list']=$show_list;
	exi($return);
}